package org.helgoboss.one_filer_template_manager

import org.helgoboss.one_filer_template._
import collection.mutable.{HashMap, SynchronizedMap}

class OneFilerTemplateManager {
    private val map = new HashMap[String, OneFilerTemplate] with SynchronizedMap[String, OneFilerTemplate]
    
    def registerTemplate(template: OneFilerTemplate) {
        map(template.id) = template
    }
    
    def unregisterTemplate(template: OneFilerTemplate) {
        map -= template.id
    }
    
    def findTemplate(templateId: String) = {
        map.get(templateId)
    }
}